Complementing init is the dealloc method. This method lets objects deallocate their instance variables and perform other clean-up tasks. The dealloc method is used primarily for Objective-C objects. Standard dealloc methods in Objective-C send each instance variable a release message to make sure that the instance variables are freed. WebScript and Java, because they have automatic garbage collection, usually make a deallocation method unnecessary. If you find it necessary, you can implement dealloc in WebScript and finalize in Java.
Table of Contents
Next Section